Skip to content

Disallow volatile keyword#8397

Open
bob80905 wants to merge 4 commits intomicrosoft:mainfrom
bob80905:remove_volatile_as_keyword
Open

Disallow volatile keyword#8397
bob80905 wants to merge 4 commits intomicrosoft:mainfrom
bob80905:remove_volatile_as_keyword

Conversation

@bob80905
Copy link
Copy Markdown
Collaborator

Fixes #8391

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff c763461468246fb779fb234b08ad3b460fb93a02 a33bfac9b624ed8b98eb914e979a35e2caa93d5a -- tools/clang/include/clang/Lex/Token.h tools/clang/lib/Parse/ParseDecl.cpp
View the diff from clang-format here.
diff --git a/tools/clang/lib/Parse/ParseDecl.cpp b/tools/clang/lib/Parse/ParseDecl.cpp
index 60329209..6cfd4982 100644
--- a/tools/clang/lib/Parse/ParseDecl.cpp
+++ b/tools/clang/lib/Parse/ParseDecl.cpp
@@ -4193,8 +4193,9 @@ HLSLReservedKeyword:
                                  getLangOpts());
       break;
     case tok::kw_volatile:
-      // HLSL Change - volatile is reserved for HLSL      
-      if (getLangOpts().HLSL) goto HLSLReservedKeyword;
+      // HLSL Change - volatile is reserved for HLSL
+      if (getLangOpts().HLSL)
+        goto HLSLReservedKeyword;
       // HLSL Change Ends
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID,
                                  getLangOpts());
  • Check this box to apply formatting changes to this branch.

Copy link
Copy Markdown
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMUE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Disallow volatile keyword

2 participants